<template>
	<view>
		<cu-custom :isBack="true" :bgColor="'bg-black'" :backColor="'text-white'">
			<block slot="backText">
				<view class="text-white ">
					返回
				</view>
			</block>
		</cu-custom>
		<Citylist @getCity="getCity"></Citylist>
	</view>
</template>

<script>
	//引入组件
	import Citylist from '../../components/bazaar-city_list/index.vue'


	//注册组件
	export default {
		components: {
			Citylist,
		},
		methods: {
			getCity(value) {
				if (value.isSelect != 1) {
					this.$u.vuex('vuex_city', value.city)
					// uni.request({
					// 	header: {
					// 		"Content-Type": "application/text"
					// 	},
					// 	//注意:这里的key值需要高德地图的 web服务生成的key  只有web服务才有逆地理编码
					// 	url: 'https://restapi.amap.com/v3/geocode/geo?key=7b7fbe6751d2491c692a1728a6c7afa4&address=' +
					// 		value.city,
					// 	success: (re) => {
					// 		if (re.statusCode === 200) {
					// 			let latitude = re.data.geocodes[0].location.split(',')[1]
					// 			let longitude = re.data.geocodes[0].location.split(',')[0]
					// 			this.$u.vuex('vuex_latitude', latitude)
					// 			this.$u.vuex('vuex_longitude', longitude)
					// 			uni.navigateBack()
					// 		} else {

					// 		}
					// 	}
					// });
					
				}
				uni.navigateBack()
				
			},
		}
	}
</script>

<style lang="scss">

</style>
